package org.henau.PathCommand;

// 4. 路径对象
import java.util.List;

public class Path {
    private final List<Coordinate> points;

    public Path(List<Coordinate> points) {
        this.points = points;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("路径[");
        for (int i = 0; i < points.size(); i++) {
            sb.append(points.get(i));
            if (i < points.size() - 1) {
                sb.append(" → ");
            }
        }
        sb.append("]");
        return sb.toString();
    }

    public List<Coordinate> getPoints() {
        return points;
    }
}